/**********************************

Covert a string from lower to upper case (flag=0)
or from upper to lowe case (flag=1)

 *******************************/



string stringconversion(string stringin, int flag){


  string stringout;
  stringout.assign(stringin);


  if(flag==0) for(int i=0;i<(int)stringin.length();i++) stringout[i]=toupper(stringin[i]);
  if(flag==1) for(int i=0;i<(int)stringin.length();i++) stringout[i]=tolower(stringin[i]);

  

  return stringout;
}
